#!/usr/bin/perl -w

$file = shift;
open FILE, "< $file";
@ar = <FILE>;

foreach (@ar) {
    if (/Fred/i) { 
    s/Fred/Larry/ig;
    }
}
open (OUT, ">", "$file.out");
print OUT @ar;
